package com.xfcy.blog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xfcy.blog.entity.User;
import com.xfcy.blog.vo.SystemUserVO;
import com.xfcy.blog.vo.UserVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 系统管理-用户基础信息表(User)表数据库访问层
 *
 * @author 晓风残月Lx
 * @since 2023-04-09 11:03:06
 */
@Repository
public interface UserMapper extends BaseMapper<User> {

    /**
     * 查询通过登录id查询
     * @param loginId
     * @return
     */
    SystemUserVO getById(@Param("loginId") Integer loginId);

    void updateLoginInfo(@Param("loginId")Object loginId,@Param("ip") String ip, @Param("cityInfo")String cityInfo,
                         @Param("os") String os,@Param("browser") String browser);

    User selectUserByName(@Param("username") String username);

    List<Integer> getMenuId(@Param("loginId") int loginId);

    Page<UserVO> selectPageRecord(@Param("page") Page<UserVO> page, @Param("username") String username, @Param("loginType") Integer loginType);

    /**
     * 查询所有用户的ip
     * @return
     */
    List<String> selectAllIpAddress();


}

